import SettingLayout from '@/views/layout/Layout'
const routerViewLayout = {
  render(h) {
    return h('router-view')
  }
}

const settingRouter = [
  // 系统管理-组织管理
  {
    path: '/setting',
    component: SettingLayout,
    name: 'system-setting',
    redirect: { name: 'organization' },
    showInSiderbar: false,
    children: [
      {
        path: '/setting/organization',
        component: () => import('@/views/organization/index'),
        name: 'organization',
        meta: { title: '组织管理', icon: 'el-icon-s-grid', noCache: true, roles: [2, 3, 4, 5] }
      },

      // 系统管理-角色管理
      {
        path: '/setting/role',
        component: () => import('@/views/roleManage/index'),
        name: 'roleManage',
        meta: { title: '角色管理', icon: 'el-icon-s-check', noCache: true, roles: [2, 3] }
      },
      // 系统管理-用户管理
      {
        path: '/setting/user',
        component: () => import('@/views/userManage/index'),
        name: 'userManage',
        meta: { title: '用户管理', icon: 'el-icon-s-custom', noCache: true, roles: [2, 3, 4, 5] }
      },
      {
        path: '/setting/dataCenter',
        name: 'dataCenter',
        component: routerViewLayout,
        meta: {
          title: '数据中心',
          icon: 'el-icon-s-data',
          roles: [2, 3, 4, 5]
        },
        children: [
          {
            path: '/setting/dataCenter/tactics',
            component: () => import('@/views/dataCenter/tactics'),
            name: 'tactics',
            meta: { title: '策略管理', icon: 'el-icon-s-promotion', noCache: true }
          },
          {
            path: '/setting/dataCenter/dataManage',
            component: () => import('@/views/dataCenter/dataManage'),
            name: 'dataManage',
            meta: { title: '数据管理', icon: 'el-icon-s-marketing', noCache: true }
          }
        ]
      }
    ]
  }
]

export default settingRouter
